import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @author ml
 * @create 2017-08-23--9:18
 */
public class HelloMethodInterceptor implements MethodInterceptor {
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println("before:"+method.getName());
        Object object=methodProxy.invokeSuper(o,objects);
        System.out.println("After:"+method.getName());
        return object;
    }


}
